You can control CreaText from other applications using AppleEvents and AppleScript.
<BR> <BR>
<FONT color="#330099" face="Chicago" size="3">
AppleEvents
</FONT><BR> <BR>
If you are programming applications, you may find it useful to send an AppleEvent to CreaText. CreaText supports the following functions using AppleEvents:<BR>
<TABLE border="0" width="400">
<!-- Row: 0 -->
<TR>
<!-- Row: 0, Column: 0 -->
<TD colspan="2" rowspan="1">
<BR><B>Launch CreaText</B>
</TD>
</TR>
<!-- Row: 1 -->
<TR>
<!-- Row: 1, Column: 0 -->
<TD colspan="1" rowspan="1">
<B>Description</B>:
</TD>
<!-- Row: 1, Column: 1 -->
<TD colspan="1" rowspan="1">
This is the commonf AppleEvent to launch CreaText.
</TD>
</TR>
<!-- Row: 2 -->
<TR>
<!-- Row: 2, Column: 0 -->
<TD colspan="1" rowspan="1">
<B>Parameters</B>:
</TD>
<!-- Row: 2, Column: 1 -->
<TD colspan="1" rowspan="1">
EventClass is "aevt", event id is "oapp"
</TD>
</TR>
<!-- Row: 3 -->
<TR>
<!-- Row: 3, Column: 0 -->
<TD colspan="2" rowspan="1">
<BR><B>Open a file with CreaText</B>
</TD>
</TR>
<!-- Row: 4 -->
<TR>
<!-- Row: 4, Column: 0 -->
<TD colspan="1" rowspan="1">
<B>Description</B>:
</TD>
<!-- Row: 4, Column: 1 -->
<TD colspan="1" rowspan="1">
This is the common AppleEvent to open a file with CreaText
</TD>
</TR>
<!-- Row: 5 -->
<TR>
<!-- Row: 5, Column: 0 -->
<TD colspan="1" rowspan="1">
<B>Parameters</B>:
</TD>
<!-- Row: 5, Column: 1 -->
<TD colspan="1" rowspan="1">
Event class is "aevt", event id is "odoc"
</TD>
</TR>
<!-- Row: 3 -->
<TR>
<!-- Row: 3, Column: 0 -->
<TD colspan="2" rowspan="1"><BR>
<B>Open a file with CreaText and go to line number</B>
</TD>
</TR>
<!-- Row: 4 -->
<TR>
<!-- Row: 4, Column: 0 -->
<TD colspan="1" rowspan="1">
<B>Description</B>:
</TD>
<!-- Row: 4, Column: 1 -->
<TD colspan="1" rowspan="1">
This is a nice AppleEvent you can use to open a file with CreaText and determine to which line number CreaText should jump
</TD>
</TR>
<!-- Row: 5 -->
<TR>
<!-- Row: 5, Column: 0 -->
<TD colspan="1" rowspan="1">
<B>Parameters</B>:
</TD>
<!-- Row: 5, Column: 1 -->
<TD colspan="1" rowspan="1">
Event class is "JAZZ", event id is "Opnf". You have to create two DescListParams. The first should have the parameter "file" and contain as information the file to open. The second one should have as parameter "line" and contain as information an integer, the line number.
</TD>
</TR>
</TABLE>
<FONT color="#330099" face="Chicago" size="3">
AppleScript
</FONT><BR> <BR>
You can use AppleScript to write scripts that command CreaText to do tasks. You can use the Script Editor to get an overview of all commands CreaText supports.
<BR>
Although there are no entries displayed in the required suite, CreaText supports the run, open, quit and print commands.<BR>
Additionally, CreaText has an AppleScript menu. You can place scripts (compiled scripts as well as text files) into the "AppleScript" folder inside the CreaText folder. When you then launch CreaText, they will be displayed in the AppleScript menu and you can select them. Take a look at the sample scripts in that folder.